$(function () {
    var $lis = $('.section-nei1>ul>li');
    $lis.mouseenter(function () {
        $(this).children('.xia').animate({
            'top': 46
        }, 200)
    })
    $lis.mouseleave(function () {
        $(this).children('.xia').animate({
            'top': 136
        }, 200);
    })
    window.onload = function () {
        $.ajax({
            url: 'http://localhost:3000/report/hot',
            type: 'get',
            success: function (res) {
                var data = [];
                for (var i = 0; i < 8; i++) {
                    data.push(res[i]);
                }
                console.log(data);
                var str = '';
                $.each(data, function (i, item) {
                    str += `
                    <li>
                        <img src="${item.img}">
                        <p>${item.text}</p>
                        <p style="margin-top:10px ;">${item.uName}<span><img src="./CSS/img/zan.png">3 &nbsp;<img src="./CSS/img/reply.png">3</span>
                        </p>
                    </li>
                    `;
                })
                $('.section-nei2 .nei2-bottom>ul').html(str);
            }
        })
        $.ajax({
            url: 'http://localhost:3000/guid/hot',
            type: 'get',
            success: function (res) {
                var data = [];
                for (var i = 0; i < 4; i++) {
                    data.push(res[i]);
                }
                console.log(data);
                var str = '';
                $.each(data, function (i, item) {
                    str += `
                    <li>
                        <img src="${item.img}">
                        <p>${item.text}</p>
                        <p style="margin-top:10px ;"><span><img src="./CSS/img/zan.png">3 &nbsp;<img src="./CSS/img/reply.png">3</span>
                                </p>
                    </li>
                    `;
                })
                $('.section-nei3>.nei2-bottom>ul').html(str);
            }
        })
        $.ajax({
            url: 'http://localhost:3000/play/hot',
            type: 'get',
            success: function (res) {
                var str = '';
                $.each(res, function (i, item) {
                    $.each(item, function (j, ite) {
                        str += `
                        <li>
                            <img src="${ite.img}">
                            <p>${ite.text}</p>
                            <p style="margin-top:10px ;">${ite.price}<span><img src="./CSS/img/zan.png">3 &nbsp;<img src="./CSS/img/reply.png">3</span>
                                    </p>
                        </li>
                        `;
                    })
                })
                $('.section-nei4 .nei2-bottom>ul').html(str);
            }
        })
    }
    $('.more').click(function () {
        $('.section-nei4').css('height', 1950);
        $('.more').css('display', 'none');
    });
})